//== GAIA ============================================================================

//== BEGINNING OF CODE ===============================================================

#include "sagittarius/core/SagittariusCore.h"

#include "sagittarius/unicode/CUnicode.h"
#include "sagittarius/re/reCS.h"

#include <stdio.h>
#include <string.h>
#include <malloc.h>

int main(int argc, char* argv[])
{
    RE_CharSet* tmp;
    RE_CharSet* s;
    RE_CharSet* t;
    RE_CharSet* u;
    
    
    s = re_createCSRange('A', 'Z');
    printf("s: ");
    re_writeCS(1, s);
    printf("\n");
    
    t = re_createCSRange('a', 'z');
    tmp = s;
    s = re_CSUnion(s,t);
    free(tmp);
    printf("s ∪ ");
    re_writeCS(1, t);
    printf(" = ");
    re_writeCS(1, s);
    printf("\n");
    
    free(t);
    t = re_createCSRange('#', ')');
    u = re_createCSRange('|', '}');
    tmp = t;
    t = re_CSUnion(t,u);
    free(tmp);
    tmp = s;
    s = re_CSUnion(s,t);
    free(tmp);
    
    //sort
    re_CSSortInPlace(s);
    printf("s ∪ ");
    re_writeCS(1, t);
    printf(" = ");
    re_writeCS(1, s);
    printf("\n");
    
    free(t);
    t = re_createCSRange('1', 'z');
    tmp = s;
    s = re_CSUnion(s,t);
    free(tmp);
    
    //sort
    re_CSSortInPlace(s);
    printf("s ∪ ");
    re_writeCS(1, t);
    printf(" = ");
    re_writeCS(1, s);
    printf("\n");
    
    free(s);
    free(t);
    free(u);
    
    return 0;
}
